
/******************************************************************************
*@file  : system_acm32f42x.h
*@brief : CMSIS Cortex-M33 Device Peripheral Access Layer System Source File
******************************************************************************/

#ifndef __SYSTEM_ACM32F42X_H
#define __SYSTEM_ACM32F42X_H

#include "acm32f42x_hal_conf.h"
    
typedef enum 
{
    SYSCLK_180M_SRC_RC64M = 0,
    SYSCLK_120M_SRC_RC64M,
    SYSCLK_80M_SRC_RC64M,
    SYSCLK_64M_SRC_RC64M,
    SYSCLK_32M_SRC_RC64M,
    SYSCLK_16M_SRC_RC64M,
    SYSCLK_8M_SRC_RC64M,

    SYSCLK_180M_SRC_XTH_12M,
    SYSCLK_120M_SRC_XTH_12M,
    SYSCLK_80M_SRC_XTH_12M,
    SYSCLK_60M_SRC_XTH_12M,
    SYSCLK_40M_SRC_XTH_12M,
    SYSCLK_25M_SRC_XTH_12M,
    SYSCLK_12M_SRC_XTH_12M

}SYSCLK_SelectTypeDef;

/******************************************************************************
*@note  : g_SystemCoreClock variable is updated in three ways:
*           1) by calling CMSIS function SystemCoreClockUpdate()
*           2) by calling HAL API function HAL_RCC_GetSysClkFreq()
*           3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency 
*               If you use this function to configure the system clock; then there
*               is no need to call the 2 first functions listed above, since g_SystemCoreClock
*               variable is updated automatically.
******************************************************************************/
extern uint32_t g_SystemCoreClock; /*!< System Clock Frequency (Core Clock) */

void SystemInit(void);
void SystemCoreClockUpdate(void);
void SystemClock_Config(SYSCLK_SelectTypeDef sysclkSel, uint32_t pclk1Div, uint32_t pclk2Div);
void System_Delay(volatile uint32_t fu32_Delay);

#endif /* __SYSTEM_ACM32F42X_H */
